package cn.sczhyt.modules.szhy.service.impl;

import cn.sczhyt.modules.app.entity.UserEntity;
import cn.sczhyt.modules.szhy.entity.MeetingTopicsFileEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.sczhyt.common.utils.PageUtils;
import cn.sczhyt.common.utils.Query;

import cn.sczhyt.modules.szhy.dao.MeetingTopicsUserDao;
import cn.sczhyt.modules.szhy.entity.MeetingTopicsUserEntity;
import cn.sczhyt.modules.szhy.service.MeetingTopicsUserService;


@Service("meetingTopicsUserService")
public class MeetingTopicsUserServiceImpl extends ServiceImpl<MeetingTopicsUserDao, MeetingTopicsUserEntity> implements MeetingTopicsUserService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<MeetingTopicsUserEntity> page = this.page(
                new Query<MeetingTopicsUserEntity>().getPage(params),
                new QueryWrapper<MeetingTopicsUserEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void saveMeetingTopicsUser(MeetingTopicsUserEntity meetingTopicsUser) {
        if (meetingTopicsUser.getId().isEmpty()) {
            System.out.println("MeetingTopicsUserServiceImpl.saveMeetingTopicsUser" + meetingTopicsUser.getId());
            this.baseMapper.insert(meetingTopicsUser);
        }else {
            this.baseMapper.updateById(meetingTopicsUser);
        }

    }

}